//
//  GuiBenDiTwoView.m
//  ZhiHuiLiJiang
//
//  Created by Work on 2018/11/18.
//  Copyright © 2018年 王雅鹏. All rights reserved.
//导览页tabviewHeadView-内容精选

#import "GuiBenDiTwoView.h"

@implementation GuiBenDiTwoView

-(instancetype)initWithReuseIdentifier:(NSString *)reuseIdentifier{
    if (self = [super initWithReuseIdentifier:reuseIdentifier]) {
        [self addView];
        self.contentView.backgroundColor = [UIColor whiteColor];
    }
    return self;
}


-(void)addView{
    [self.contentView addSubview:self.titleLabel];
    [self.contentView addSubview:self.Btn];

    [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(self.contentView.mas_left).offset(10);
        make.bottom.mas_equalTo(self.contentView.mas_bottom);

    }];
    [self.Btn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.mas_equalTo(self.mas_right).offset(-10);
        make.centerY.mas_equalTo(self.titleLabel.mas_centerY);
        make.size.mas_equalTo(CGSizeMake(60, 20));
        
    }];
    
}

-(UIButton *)Btn{
    if (!_Btn) {
        _Btn = [UIButton buttonWithType:UIButtonTypeCustom];
        [_Btn setTitle:@"查看更多" forState:UIControlStateNormal];
        _Btn.titleLabel.font = H13;
        [_Btn setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
        [_Btn addTarget:self action:@selector(btnclick) forControlEvents:UIControlEventTouchUpInside];
        
    }
    return _Btn;
}
-(UILabel *)titleLabel{
    if (!_titleLabel) {
        _titleLabel = [[UILabel alloc]init];
        _titleLabel.font = H14;
    }
    return _titleLabel;
}

-(void)btnclick{
    if ([self.delegate respondsToSelector:@selector(GuiBenDiTwoViewmoreBtn)]) {
        [self.delegate GuiBenDiTwoViewmoreBtn];
    }
}
@end
